from datetime import datetime, timedelta

def generate_schedule(start_date_str, weeks, start_time_str, duration):
    # 解析起始日期和上课时间
    start_date = datetime.strptime(start_date_str, '%Y-%m-%d')
    start_time = datetime.strptime(start_time_str, '%H:%M').time()

    # 将上课时长转换为timedelta对象
    duration_delta = timedelta(minutes=duration)

    # 输出每周的日期和上下课时间
    for week in range(1, weeks + 1):
        # 计算每周的日期
        date = start_date + timedelta(weeks=week - 1)

        # 结合日期和上课时间
        class_start = datetime.combine(date.date(), start_time)
        class_end = class_start + duration_delta

        # 输出结果
        print(f"{date.strftime('%Y-%m-%d')} {class_start.strftime('%H:%M:%S')}\t{date.strftime('%Y-%m-%d')} {class_end.strftime('%H:%M:%S')}")

# 示例输入
start_date_str = '2024-9-23'  # 起始日期，格式为YYYY-MM-DD
weeks = 6  # 周数
start_time_str = '8:00'  # 上课时间，格式为HH:MM
duration = 190  # 上课时长，以分钟为单位

# 调用函数并输出结果
generate_schedule(start_date_str, weeks, start_time_str, duration)